<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta name="Content-Type" content="text/html; charset=UTF-8" />
<title>Class: Sass::Exec::Sass</title>
<link rel="stylesheet" href="style.css" tppabs="http://sass-lang.com/docs/yardoc/css/style.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="common.css" tppabs="http://sass-lang.com/docs/yardoc/css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  relpath = '../..';
  if (relpath != '') relpath += '/';
</script>
<script type="text/javascript" charset="utf-8" src="jquery.js" tppabs="http://sass-lang.com/docs/yardoc/js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="app.js" tppabs="http://sass-lang.com/docs/yardoc/js/app.js"></script>

  </head>
  <body>
    <script type="text/javascript" charset="utf-8">
      if (window.top.frames.main) document.body.className = 'frames';
    </script>
    
    <div id="header">
      <div id="menu">
  
    <a href="_index.html" tppabs="http://sass-lang.com/docs/yardoc/_index.html">Index (S)</a> &raquo; 
    <span class='title'><a href="Sass-1.html" tppabs="http://sass-lang.com/docs/yardoc/Sass.html" title="Sass (module)">Sass</a></span> &raquo; <span class='title'><a href="Exec.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Exec.html" title="Sass::Exec (module)">Exec</a></span>
     &raquo; 
    <span class="title">Sass</span>
  
  
  <div class="noframes"><span class="title">(</span><a href="javascript:if(confirm(%27http://sass-lang.com/docs/yardoc/Sass/Exec/.  \n\nThis file was not retrieved by Teleport Pro, because the server reports that this file cannot be found.  \n\nDo you want to open it from the server?%27))window.location=%27http://sass-lang.com/docs/yardoc/Sass/Exec/.%27" tppabs="http://sass-lang.com/docs/yardoc/Sass/Exec/." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  <a id="class_list_link" href="#">Class List</a>
  <a id="method_list_link" href="#">Method List</a>
  <a id ="file_list_link" href="#">File List</a>
</div>

      <div class="clear"></div>
    </div>
    
    <iframe id="search_frame"></iframe>
    
    <div id="content"><h1>Class: Sass::Exec::Sass 
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName"><a href="Generic.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Exec/Generic.html" title="Sass::Exec::Generic (class)">Generic</a></span>
      
        <ul class="fullTree">
          <li>Object</li>
          
            <li class="next"><a href="Generic.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Exec/Generic.html" title="Sass::Exec::Generic (class)">Generic</a></li>
          
            <li class="next">Sass::Exec::Sass</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
      </dd>
    
  
  
    
  
    
  
  
    <dt class="r2 last">Defined in:</dt>
    <dd class="r2 last">/var/www/sass-pages/.sass/lib/sass/exec.rb</dd>
  
</dl>
<div class="clear"></div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    <p>The <code>sass</code> executable.</p>

  </div>
</div>
<div class="tags">
  
</div><div id="subclasses">
  <h2>Direct Known Subclasses</h2>
  <p class="children"><a href="Scss-1.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Exec/Scss.html" title="Sass::Exec::Scss (class)">Scss</a></p>
</div>

  <h2>Constant Summary</h2>
  


  
  
  
  
  <h2>Instance Attribute Summary</h2>
  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#default_syntax-instance_method" title="#default_syntax (instance method)">- <strong>default_syntax</strong> </a>
    

    
  </span>
  
  
    <span class="note title readonly">readonly</span>
    
  
  
  
  

  
    <span class="summary_desc">Returns the value of attribute default_syntax.</span>
  
</li>

    
  </ul>


  <h2>Instance Method Summary</h2>

  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#initialize-instance_method" title="#initialize (instance method)">- (Sass) <strong>initialize</strong>(args) </a>
    

    
  </span>
  
    <span class="note title constructor">constructor</span>
  
  
  
  
  

  
    <span class="summary_desc">A new instance of Sass.</span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#process_result-instance_method" title="#process_result (instance method)">- <strong>process_result</strong> </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc">Processes the options set by the command-line arguments, and runs the Sass compiler appropriately.</span>
  
</li>

    
      <li class="protected ">
  <span class="summary_signature">
    
      <a href="#set_opts-instance_method" title="#set_opts (instance method)">- <strong>set_opts</strong>(opts) </a>
    

    
  </span>
  
  
  <span class="note title protected">protected</span>
  
  

  
    <span class="summary_desc">Tells optparse how to parse the arguments.</span>
  
</li>

    
  </ul>

  
  
  
  
  
  <h3 class="inherited">Methods inherited from <a href="Generic.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Exec/Generic.html" title="Sass::Exec::Generic (class)">Generic</a></h3>
  <p class="inherited"><a href="Generic.html#color-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Exec/Generic.html#color-instance_method" title="Sass::Exec::Generic#color (method)">#color</a>, <a href="Generic.html#get_line-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Exec/Generic.html#get_line-instance_method" title="Sass::Exec::Generic#get_line (method)">#get_line</a>, <a href="Generic.html#parse-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Exec/Generic.html#parse-instance_method" title="Sass::Exec::Generic#parse (method)">#parse</a>, <a href="Generic.html#parse%21-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Exec/Generic.html#parse%21-instance_method" title="Sass::Exec::Generic#parse! (method)">#parse!</a>, <a href="Generic.html#puts-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Exec/Generic.html#puts-instance_method" title="Sass::Exec::Generic#puts (method)">#puts</a>, <a href="Generic.html#puts_action-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Exec/Generic.html#puts_action-instance_method" title="Sass::Exec::Generic#puts_action (method)">#puts_action</a>, <a href="Generic.html#to_s-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Exec/Generic.html#to_s-instance_method" title="Sass::Exec::Generic#to_s (method)">#to_s</a></p>
<div id="constructor_details" class="method_details_list">
  <h2>Constructor Details</h2>
  
    <div class="method_details first">
  <p class="signature first" id="initialize-instance_method">
  
    - (<tt><a href="" title="Sass::Exec::Sass (class)">Sass</a></tt>) <strong>initialize</strong>(args) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>A new instance of Sass</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>Array&lt;String&gt;</tt>)</span>
      
      
        <span class='name'>args</span>
      
      
      
        &mdash;
        The command-line arguments
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


184
185
186
187
188
189
190</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/exec.rb', line 184</span>

def initialize(args)
  super
  @options[:for_engine] = {
    :load_paths => ['.'] + (ENV['SASSPATH'] || '').split(File::PATH_SEPARATOR)
  }
  @default_syntax = :sass
end</pre>
    </td>
  </tr>
</table>
</div>
  
</div>

  <div id="instance_attr_details" class="attr_details">
    <h2>Instance Attribute Details</h2>
    
      
      <span id=""></span>
      <span id="default_syntax-instance_method"></span>
      <div class="method_details first">
  <p class="signature first" id="default_syntax-instance_method">
  
    - <strong>default_syntax</strong>  <span class="extras">(readonly)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Returns the value of attribute default_syntax</p>

  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


181
182
183</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/exec.rb', line 181</span>

def default_syntax
  @default_syntax
end</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>


  <div id="instance_method_details" class="method_details_list">
    <h2>Instance Method Details</h2>
    
    
      <div class="method_details first">
  <p class="signature first" id="process_result-instance_method">
  
    - <strong>process_result</strong>  <span class="extras">(protected)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Processes the options set by the command-line arguments, and runs the Sass compiler appropriately.</p>

  </div>
</div>
<div class="tags">
  
</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/exec.rb', line 296</span>

def process_result
  require 'sass'

  if !@options[:update] && !@options[:watch] &&
      @args.first && colon_path?(@args.first)
    if @args.size == 1
      @args = split_colon_path(@args.first)
    else
      @options[:update] = true
    end
  end
  load_compass if @options[:compass]
  return interactive if @options[:interactive]
  return watch_or_update if @options[:watch] || @options[:update]
  super
  @options[:for_engine][:filename] = @options[:filename]
  @options[:for_engine][:css_filename] = @options[:output].path if @options[:output].is_a?(File)

  begin
    input = @options[:input]
    output = @options[:output]

    @options[:for_engine][:syntax] ||= :scss if input.is_a?(File) && input.path =~ /\.scss$/
    @options[:for_engine][:syntax] ||= @default_syntax
    engine =
      if input.is_a?(File) && !@options[:check_syntax]
        ::Sass::Engine.for_file(input.path, @options[:for_engine])
      else
        # We don't need to do any special handling of @options[:check_syntax] here,
        # because the Sass syntax checking happens alongside evaluation
        # and evaluation doesn't actually evaluate any code anyway.
        ::Sass::Engine.new(input.read(), @options[:for_engine])
      end

    input.close() if input.is_a?(File)

    output.write(engine.render)
    output.close() if output.is_a? File
  rescue ::Sass::SyntaxError => e
    raise e if @options[:trace]
    raise e.sass_backtrace_str("standard input")
  end
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="set_opts-instance_method">
  
    - <strong>set_opts</strong>(opts)  <span class="extras">(protected)</span>
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Tells optparse how to parse the arguments.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>OptionParser</tt>)</span>
      
      
        <span class='name'>opts</span>
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/exec.rb', line 197</span>

def set_opts(opts)
  super

  opts.banner = "Usage: \#{default_syntax} [options] [INPUT] [OUTPUT]\n\nDescription:\n  Converts SCSS or Sass files to CSS.\n\nOptions:\n"

  if @default_syntax == :sass
    opts.on('--scss',
            'Use the CSS-superset SCSS syntax.') do
      @options[:for_engine][:syntax] = :scss
    end
  else
    opts.on('--sass',
            'Use the Indented syntax.') do
      @options[:for_engine][:syntax] = :sass
    end
  end
  opts.on('--watch', 'Watch files or directories for changes.',
                     'The location of the generated CSS can be set using a colon:',
                     "  #{@default_syntax} --watch input.#{@default_syntax}:output.css",
                     "  #{@default_syntax} --watch input-dir:output-dir") do
    @options[:watch] = true
  end
  opts.on('--update', 'Compile files or directories to CSS.',
                      'Locations are set like --watch.') do
    @options[:update] = true
  end
  opts.on('--stop-on-error', 'If a file fails to compile, exit immediately.',
                             'Only meaningful for --watch and --update.') do
    @options[:stop_on_error] = true
  end
  opts.on('--poll', 'Check for file changes manually, rather than relying on the OS.',
                    'Only meaningful for --watch.') do
    @options[:poll] = true
  end
  opts.on('-f', '--force', 'Recompile all Sass files, even if the CSS file is newer.',
                           'Only meaningful for --update.') do
    @options[:force] = true
  end
  opts.on('-c', '--check', "Just check syntax, don't evaluate.") do
    require 'stringio'
    @options[:check_syntax] = true
    @options[:output] = StringIO.new
  end
  opts.on('-t', '--style NAME',
          'Output style. Can be nested (default), compact, compressed, or expanded.') do |name|
    @options[:for_engine][:style] = name.to_sym
  end
  opts.on('--precision NUMBER_OF_DIGITS', Integer,
          'How many digits of precision to use when outputting decimal numbers. Defaults to 3.') do |precision|
    ::Sass::Script::Number.precision = precision
  end
  opts.on('-q', '--quiet', 'Silence warnings and status messages during compilation.') do
    @options[:for_engine][:quiet] = true
  end
  opts.on('--compass', 'Make Compass imports available and load project configuration.') do
    @options[:compass] = true
  end
  opts.on('-g', '--debug-info',
          'Emit extra information in the generated CSS that can be used by the FireSass Firebug plugin.') do
    @options[:for_engine][:debug_info] = true
  end
  opts.on('-l', '--line-numbers', '--line-comments',
          'Emit comments in the generated CSS indicating the corresponding source line.') do
    @options[:for_engine][:line_numbers] = true
  end
  opts.on('-i', '--interactive',
          'Run an interactive SassScript shell.') do
    @options[:interactive] = true
  end
  opts.on('-I', '--load-path PATH', 'Add a sass import path.') do |path|
    @options[:for_engine][:load_paths] << path
  end
  opts.on('-r', '--require LIB', 'Require a Ruby library before running Sass.') do |lib|
    require lib
  end
  opts.on('--cache-location PATH', 'The path to put cached Sass files. Defaults to .sass-cache.') do |loc|
    @options[:for_engine][:cache_location] = loc
  end
  opts.on('-C', '--no-cache', "Don't cache to sassc files.") do
    @options[:for_engine][:cache] = false
  end

  unless ::Sass::Util.ruby1_8?
    opts.on('-E encoding', 'Specify the default encoding for Sass files.') do |encoding|
      Encoding.default_external = encoding
    end
  end
end</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>
    
    <div id="footer">
  Generated on Fri Mar  8 20:33:44 2013 by 
  <a href="javascript:if(confirm(%27http://yardoc.org/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://yardoc.org/%27" tppabs="http://yardoc.org/" title="Yay! A Ruby Documentation Tool">yard</a>
  0.5.3 (ruby-1.8.7).
</div>


  <script type="text/javascript">
  var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
  </script>
  <script type="text/javascript">
  try {
  var pageTracker = _gat._getTracker("UA-535380-8");
  pageTracker._trackPageview();
  } catch(err) {}</script>


  </body>
</html>